﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Modules.storage {
    import flash.utils.*;
    import Classes.*;
    import validation.*;

    public class StorageType {

        public static const ITEM_TYPE:StorageType = new StorageType("itemType");
;
        public static const STORAGE_ITEM_TYPE:StorageType = new StorageType("storageItemType");
;

        private static var map:Dictionary = new Dictionary();
        private static var m_dict:Dictionary;

        private var m_type:String;

        public function StorageType(_arg1:String){
            if (m_dict == null){
                m_dict = new Dictionary();
            };
            this.m_type = _arg1;
            m_dict[_arg1] = this;
        }
        public static function validateItemType(_arg1:ItemInstance, _arg2:String):Boolean{
            return ((_arg1.getItem().type == _arg2));
        }
        public static function validateStorageItemType(_arg1:ItemInstance, _arg2:String):Boolean{
            var _local3:GenericValidationScript = Global.gameSettings.getItemByName(_arg2).getValidation("storage");
            return (((!((_local3 == null))) && (_local3.validate(_arg1))));
        }
        public static function getValidateFunction(_arg1:StorageType):Function{
            return (map[_arg1]);
        }
        public static function createEnum(_arg1:String):StorageType{
            return ((m_dict[_arg1] as StorageType));
        }

        public function get type():String{
            return (this.m_type);
        }

        map[StorageType.ITEM_TYPE] = validateItemType;
        map[StorageType.STORAGE_ITEM_TYPE] = validateStorageItemType;
    }
}//package Modules.storage 
